home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / egrep.zip / REGX.ZIP / FIX3 < prev    next >
Text File  |  1987-06-19  |  832b  |  28 lines

  1. Subject: 2nd bug fix for regexp(3), in regsub()
  2. Newsgroups: mod.sources
  3. Approved: jpn@panda.UUCP
  4.  
  5. Mod.sources:  Volume 4, Issue 33
  6. Submitted by: genrad!decvax!utzoo!henry
  7.  
  8. I cringe with embarrassment!  Another bug in regexp!  In regsub.c, the
  9. following line (line 72 in the original distribution):
  10.  
  11.     if (*(dst-1) == '\0') {        /* strncpy hit NUL. */
  12.  
  13. should read
  14.  
  15.     if (len != 0 && *(dst-1) == '\0') {    /* strncpy hit NUL. */
  16.  
  17. This shows up as an occasional spurious complaint from regsub about
  18. "damaged match string"... *if* the program invoking it, and the compiler
  19. compiling it, happen to interact just right.  It didn't show in any of
  20. my tests because mine don't.
  21.  
  22. My thanks to H}vard Eidnes for finding this.
  23.  
  24.                 Henry Spencer @ U of Toronto Zoology
  25.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  26.  
  27.  
  28.